Admin: Standardize mobile viewport heights for interactive elements#11750
Admin: Standardize mobile viewport heights for interactive elements#11750himanshupathak95 wants to merge 10 commits into
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
dca69f9 to
220cc0c
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
220cc0c to
3f78edc
Compare
t-hamano
left a comment
There was a problem hiding this comment.
Thanks for the PR! It looks good for the most part, but there are a few points that need further adjustment.
Media Library (List view): We should be able to use the button-compact class on these two buttons without writing any CSS.
Install Themes: These buttons should be 32px in size.
Install Plugins: These buttons should be 32px in size.
3f78edc to
2545903
Compare
2545903 to
c4e83fc
Compare
|
Thanks @t-hamano for the suggestions and catching the leftovers. I've tried to use classes and avoid hardcoding as much as possible.
|
| if ( $this->is_trash && $this->has_items() | ||
| && current_user_can( 'edit_others_posts' ) | ||
| ) { | ||
| submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false ); |
There was a problem hiding this comment.
| submit_button( __( 'Empty Trash' ), 'apply button-compact', 'delete_all', false ); |
This is not directly related to this PR, but it would be good to standardize this button as well. Here's how to display this button.
- Add
define( 'MEDIA_TRASH', true ); - Upload multiple media files and move some of them to the trash.
- Access http://localhost:8889/wp-admin/upload.php?attachment-filter=trash.
| .plugin-action-buttons li .button { | ||
| min-height: 32px; | ||
| line-height: 2.30769231; /* 30px for 32px min-height */ | ||
| font-size: 13px; | ||
| padding: 0 12px; | ||
| } |
| font-size: 14px; | ||
| vertical-align: middle; | ||
| min-height: 40px; | ||
| margin-bottom: 4px; |
There was a problem hiding this comment.
The .wp-core-ui .button class applies to all buttons in the dashboard, so removing the bottom margin could have unintended consequences. Let's restore this bottom margin.
There was a problem hiding this comment.
Introduced in [26386], these work perfectly when the input and button sizes were not 40px; now that they are, this creates a slight misalignment -
Screen.Recording.2026-05-13.at.13.57.06.mov
I checked the admin UI for any breaking changes, but could not find anything noticeable.
There was a problem hiding this comment.
My prediction is that this bottom margin is necessary to create a gap between the adjacent elements when the button wraps on mobile. If consumers have configured layouts that rely on this bottom margin, removing it could impact those layouts.
|
Thanks @t-hamano for the reply.
I intentionally made them 32px in size since you asked the same in #11750 (review), specifically -
I also feel like they should have |
Apologies, there was an error in my explanation. What I meant to say is that all buttons should always be 40px on mobile. This means that a button with a 32px size in the desktop layout should change to a 40px size in the mobile layout. To achieve this, I wanted to suggest that the "button-compact" CSS class would be appropriate. |





Trac ticket: https://core.trac.wordpress.org/ticket/64999
This PR fixes inconsistent interactive element heights to 40px in the admin mobile viewport (≤782px) on:
Follow-up to [62294].
Tested in Chrome at 782px viewport width (mobile emulation). Before/after
screenshots attached.